package web.com.utils;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 *@Description
 *@author shine
 *创建时间2022/8/9 14:18
 */
@Data
@MappedSuperclass
public class SuperEntity {


    /**
     * id主键
     */
    @Id
    @Column(length = 64, unique = true, nullable = false)
    @TableId(type = IdType.UUID)
    private String id;
//    /**
//     * uuid
//     */
//    @Column(name = "code", nullable = true, length = 128)
//    @ApiModelProperty(value = "uuid", name = "code", hidden = false)
//    private String code;

    /**
     * 创建时间
     */


    //@ApiModelProperty(value = "创建时间",example = "创建时间", name = "createTime",hidden = true)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 修改时间
     */

   // @ApiModelProperty(value = "修改时间",example = "修改时间", name = "updateTime",hidden = true)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
